import { http } from '@/utils/https'
import type { DeviceList, DeviceDetail, DeviceStatus } from '@/types/index'

type result = {
  devices: DeviceList
}
//根据用户获取名下设备信息
export const getDeviceInfoApi = (userId: number) => {
  return http<result>({
    url: `/person/device/list/${userId}`,
    method: 'POST',
  })
}

//根据设备ID获取指定设备的当前状态
export const getDeviceStatusApi = (deviceId: number) => {
  return http<DeviceStatus>({
    url: `/status/detail/${deviceId}`,
    method: 'POST',
  })
}
